package com.desgin.factory_mod.simple;

import com.desgin.factory_mod.simple.fac.OperationFactory;
import com.desgin.factory_mod.simple.operation.Operation;

/**
 * Created by zhaoshuai on 2017/4/10.
 */
public class Main {
    public static void main(String[] args){

        Operation addoperation = OperationFactory.createOperation("+");
        int addResult = addoperation.computer(1,2);
        System.out.println("操作结果为:"+addResult);

        Operation suboperation = OperationFactory.createOperation("-");
        int subResult = suboperation.computer(1,2);
        System.out.println("操作结果为:"+subResult);

        Operation muloperation = OperationFactory.createOperation("*");
        int mulResult = muloperation.computer(1,2);
        System.out.println("操作结果为:"+mulResult);

        Operation divoperation = OperationFactory.createOperation("/");
        int divResult = divoperation.computer(1,2);
        System.out.println("操作结果为:"+divResult);



    }
}
